package com.company2021.meituan7;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * TODO
 *
 * @author lefly
 * @version 1.0
 * @classname Main1
 * @description
 * @date 2021/3/11 下午3:35
 */
public class Main1 {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int m = sc.nextInt();
        int n = sc.nextInt();
        int res = 0;
        for(int i = m;i <= n;i++){
            Set<Integer> s = new HashSet<>();
            int origin = i;
            int a = origin / 100000;
            if(a == 0){
                continue;
            }
            s.add(a);
            origin = origin - 100000 * a;
            int b = origin / 10000;
            origin = origin - 10000 * b;
            s.add(b);
            int c = origin / 1000;
            if(c == 0){
                continue;
            }
            s.add(c);
            origin = origin - 1000 * c;
            int d = origin / 100;
            s.add(d);
            origin = origin - 100 * d;
            int e = origin / 10;
            if(e == 0){
                continue;
            }
            s.add(e);
            int f = origin - 10 * e;
            s.add(f);
            if(s.size() != 6){
                continue;
            }
            if(10 * a + b + 10 * c + d == 10 * e + f){
                res++;
            }

        }
        System.out.println(res);
    }

}
